<?php

/**
 * Video form.
 *
 * @package    sf_sandbox
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfPropelFormTemplate.php 10377 2008-07-21 07:10:32Z dwhittle $
 */
class profileVideoForm extends BaseVideoForm
{
  public function configure()
  {
  	  	  	unset(
  		$this['created_at'],
  		$this['photo_path'],
  		$this['updated_at']);


  $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'user_id' =>  new sfWidgetFormInputHidden(),
      'video_path' => new sfWidgetFormInputFile()
    ));

    if(sfConfig::get('app_video_autoapprove')=='true')
    {

    	 $this->widgetSchema['pub'] =  new sfWidgetFormInputHidden( array (), array ('value' =>'3'));
    }

    ///'video_path' => new sfWidgetFormInputSWFUpload()
        $this->validatorSchema ['video_path'] = new sfValidatorFile ( array ('required' => true,
		'path' => sfConfig::get ( 'sf_web_dir' ) . '/uploads/users/video',
        'mime_types'=>array('video/avi','video/x-msvideo','application/octet-stream', 'video/x-ms-wmv', 'video/x-ms-wmv','text/plain'),
		'max_size' => 20000000,
        'validated_file_class' => 'sfVideoValidatedFile' ),
        array ('invalid' => 'Invalid file.',
         'required' => 'Select a file to upload.',
         'mime_types' => 'The file must be of AVI format.' )
        );
                $this->widgetSchema->setLabels ( array ('video_path' => 'Путь к файлу'));
  		$this->validatorSchema->setOption ( 'allow_extra_fields', true );
  		$this->widgetSchema->setNameFormat('video[%s]');

  }
}
?>